]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Treat a menu will all invisible menu items as empty
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 14 Feb 2013 21:48:28 +0000 (16:48 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 14 Feb 2013 23:16:21 +0000 (18:16 -0500)
As an example, a menu that has only settings actions might
be "empty" if allowSettings is false.

https://bugzilla.gnome.org/show_bug.cgi?id=681540

js/ui/popupMenu.js

index 9807b627521fb1c4484f48f7b1b90c484dcc40e7..5123696f332b738a2d1d92c3c8b68dd5658e1089 100644 (file)
@@ -914,7 +914,11 @@ const PopupMenuBase = new Lang.Class({
     },
 
     isEmpty: function() {
-        return this.box.get_n_children() == 0;
+        let hasVisibleChildren = this.box.get_children().some(function(child) {
+            return child.visible;
+        });
+
+        return !hasVisibleChildren;
     },
 
     isChildMenu: function(menu) {